@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <link href="/lib/ueditor/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" charset="utf-8" src="/lib/ueditor/umeditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/lib/ueditor/umeditor.min.js"></script>
    <script type="text/javascript" src="/lib/ueditor/lang/zh-cn/zh-cn.js"></script>
    <script src="/js/upload.js" type="text/javascript"></script>
    <script src="/js/mobileBUGFix.mini.js" type="text/javascript"></script>
    <div class="content">
        <!-- <div class="header">
            <ul class="breadcrumb">
                <li><a href="">更新设置</a> </li>
            </ul>
        </div> -->
        <div class="main-content header">
            <a href="/establish/updateType"><button type="button" class="btn btn-primary">更新缓存</button></a>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading no-collapse">分类列表-（共有{{$count}}条记录）</div>
            <table class="table table-hover">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>键名</th>
                    {{--<th>操作</th>--}}
                </tr>
                </thead>
                <tbody>
                    @foreach($type as $k=>$v)
                    <div class="panel-group">
                        <tr>
                            <td>{{$k}}</td>
                            <td>{{$v}}</td>
                            {{--<td><a href="javascript:;" class="btn btn-info" data-id="index">删除</a></td>--}}
                        </tr>
                    </div>
                    @endforeach

                </tbody>
            </table>
        </div>
    </div>
    <script src="/lib/jquery.validate.js" type="text/javascript"></script>
    <script>
        function updateCache(e){
            var info = e.getAttribute("data-id");
            var list = '';
            console.log(list);
            var token     = '{{csrf_token()}}';
            $.ajax({
                type:"POST",
                url:"/establish/updateCache",
                data:{info:info,list:list,_token:token},
                dataType:"json",
                success:function(result){
                    if(result.code==1){
                        alert('操作成功');
                    }else{
                        alert('失败');
                    }
                }
            });
        }
    </script>

@endsection